/*
 * Copyright (c) 2024, salesforce.com, inc.
 * All rights reserved.
 * Licensed under the BSD 3-Clause license.
 * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
 */
export const variables = [
  '{',
  '  "Overrides": {',
  '    "label": "Overrides",',
  '    "description": "Internal configuration to allow asset creation overrides, not to be displayed in UI.",',
  '    "defaultValue": {',
  '      "createAllDashboards": true,',
  '      "createAllLenses": true,',
  '      "createAllExternalFiles": true,',
  '      "createDataflow": true,',
  '      "createAllDatasetFiles": true,',
  '      "createAllImages": true',
  '    },',
  '    "required": true,',
  '    "excludeSelected": false,',
  '    "excludes": [],',
  '    "variableType": {',
  '      "required": [',
  '        "createAllExternalFiles",',
  '        "createAllDashboards",',
  '        "createAllImages",',
  '        "createAllDatasetFiles",',
  '        "createAllLenses",',
  '        "createDataflow"',
  '      ],',
  '      "type": "ObjectType",',
  '      "properties": {',
  '        "createAllDashboards": {',
  '          "type": "BooleanType",',
  '          "enums": [true, false]',
  '        },',
  '        "createAllLenses": {',
  '          "type": "BooleanType",',
  '          "enums": [true, false]',
  '        },',
  '        "createAllExternalFiles": {',
  '          "type": "BooleanType",',
  '          "enums": [true, false]',
  '        },',
  '        "createDataflow": {',
  '          "type": "BooleanType",',
  '          "enums": [true, false]',
  '        },',
  '        "createAllDatasetFiles": {',
  '          "type": "BooleanType",',
  '          "enums": [true, false]',
  '        },',
  '        "createAllImages": {',
  '          "type": "BooleanType",',
  '          "enums": [true, false]',
  '        }',
  '      },',
  '      "strictValidation": true',
  '    }',
  '  }',
  '}'
].join('\n');

export const ui = ['{', '  "pages": [],', '  "displayMessages": []', '}'].join('\n');

export const templateToAppRules = ['{', '  "constants": [],', '  "macros": [],', '  "rules": []', '}'].join('\n');

export const templateInfo = [
  '{',
  '  "templateType": "app",',
  '  "label": "sat1",',
  '  "name": "sat1",',
  '  "description": "",',
  '  "assetVersion": 57.0,',
  '  "variableDefinition": "variables.json",',
  '  "uiDefinition": "ui.json",',
  '  "rules": [',
  '    {',
  '      "type": "templateToApp",',
  '      "file": "template-to-app-rules.json"',
  '    },',
  '    {',
  '      "type": "appToTemplate",',
  '      "file": "app-to-template-rules.json"',
  '    }',
  '  ],',
  '  "releaseInfo": {',
  '    "templateVersion": "1.0",',
  '    "notesFile": "releaseNotes.html"',
  '  },',
  '  "folderDefinition": "folder.json",',
  '  "externalFiles": [],',
  '  "lenses": [],',
  '  "dashboards": [',
  '    {',
  '      "label": "sat1Dashboard",',
  '      "name": "sat1Dashboard_tp",',
  '      "condition": "${Variables.Overrides.createAllDashboards}",',
  '      "file": "dashboards/sat1Dashboard.json"',
  '    }',
  '  ],',
  '  "eltDataflows": [],',
  '  "datasetFiles": [],',
  '  "imageFiles": [],',
  '  "extendedTypes": {},',
  '  "templateDependencies": [],',
  '  "icons": {',
  '    "appBadge": {',
  '      "name": "16.png"',
  '    },',
  '    "templateBadge": {',
  '      "name": "default.png"',
  '    },',
  '    "templatePreviews": []',
  '  }',
  '}'
].join('\n');

export const releaseNotes = '<h2>Release Notes for Template</h2>';

export const folder = [
  '{',
  '  "name": "sat1",',
  '  "label": "sat1",',
  '  "description": "Analytics template with one simple dashboard",',
  '  "featuredAssets": {},',
  '  "shares": []',
  '}'
].join('\n');

export const appToTemplateRules = ['{', '  "constants": [],', '  "macros": [],', '  "rules": []', '}'].join('\n');

export const dashboard = [
  '{',
  '  "name": "sat1Dashboard_tp",',
  '  "label": "sat1Dashboard",',
  '  "description": "sat1 dashboard",',
  '  "folder": {',
  '    "id": "${App.Folder.Id}"',
  '  },',
  '  "dateVersion": 1,',
  '  "mobileDisabled": false,',
  '  "xmd": {',
  '    "measures": [],',
  '    "derivedDimensions": [],',
  '    "organizations": [],',
  '    "showDetailsDefaultFields": [],',
  '    "dates": [],',
  '    "derivedMeasures": [],',
  '    "dimensions": []',
  '  },',
  '  "state": {',
  '    "dataSourceLinksInfo": {',
  '      "enableAutomaticLinking": false,',
  '      "excludeRelationships": [],',
  '      "links": []',
  '    },',
  '    "filters": [],',
  '    "gridLayouts": [',
  '      {',
  '        "name": "Default",',
  '        "numColumns": 12,',
  '        "pages": [',
  '          {',
  '            "label": "Untitled",',
  '            "name": "c07278f3-c01f-4fd6-9139-3878a548f264",',
  '            "navigationHidden": false,',
  '            "widgets": [',
  '              {',
  '                "colspan": 8,',
  '                "column": 0,',
  '                "name": "text_1",',
  '                "row": 0,',
  '                "rowspan": 13,',
  '                "widgetStyle": {',
  '                  "borderEdges": []',
  '                }',
  '              }',
  '            ]',
  '          }',
  '        ],',
  '        "rowHeight": "normal",',
  '        "selectors": [],',
  '        "style": {',
  '          "alignmentX": "left",',
  '          "alignmentY": "top",',
  '          "backgroundColor": "#F2F6FA",',
  '          "cellSpacingX": 8,',
  '          "cellSpacingY": 8,',
  '          "fit": "original",',
  '          "gutterColor": "#C5D3E0"',
  '        },',
  '        "version": 1.0',
  '      }',
  '    ],',
  '    "layouts": [],',
  '    "steps": {},',
  '    "widgetStyle": {',
  '      "backgroundColor": "#FFFFFF",',
  '      "borderColor": "#E6ECF2",',
  '      "borderEdges": [],',
  '      "borderRadius": 0,',
  '      "borderWidth": 1',
  '      },',
  '    "widgets": {',
  '      "text_1": {',
  '        "parameters": {',
  '          "content": {',
  '            "richTextContent": [',
  '              {',
  '                "attributes": {',
  '                  "size": "48px",',
  '                  "color": "rgb(9, 26, 62)"',
  '                },',
  '                "insert": "sat1 Analytics Dashboard"',
  '              },',
  '              {',
  '                "attributes": {',
  '                  "align": "center"',
  '                },',
  '                "insert": "\\n"',
  '              }',
  '            ]',
  '          },',
  '          "interactions": [],',
  '          "showActionMenu": true',
  '        },',
  '        "type": "text"',
  '      }',
  '    }',
  '  }',
  '}'
].join('\n');
